using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace eCSS
{
    public partial class uscUser : System.Web.UI.UserControl
    {
        public string TrangNguoiDung;
        public string TrangAdmin;
        public string TrangKhachHang;
        public int NguoiDungID
        {
            get
            {
                if (Session["NguoiDungID"] == null)
                {
                    return -1;
                }
                else
                {
                    return (Convert.ToInt32(Session["NguoiDungID"]));
                }
            }
            set
            {
                Session["NguoiDungID"] = value;
            }
        }
        public string TaiKhoan
        {
            get
            {
                if (Session["TaiKhoan"] == null)
                {
                    return "";
                }
                else
                {
                    return (Convert.ToString(Session["TaiKhoan"]));
                }
            }
            set
            {
                Session["TaiKhoan"] = value;
            }
        }
        public bool DangNhap
        {
            get
            {
                if (Session["TaiKhoan"] == null)
                {
                    return false;
                }
                else
                {
                    return  true;
                }
            }
          
        }
        public bool IsAdmin
        {
            get
            {
                if (Session["IsAdmin"] == null)
                {
                    return false;
                }
                else
                {
                    return (Convert.ToBoolean(Session["IsAdmin"]));
                }
            }
            set
            {
                Session["IsAdmin"] = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                /*lnkDangNhap.Visible = (NguoiDungID == -1);
                lnkDangKy.Visible = (NguoiDungID == -1);
                lnkThoat.Visible = (NguoiDungID != -1);*/
            }
        }
    }
}